package basetest.wsf

import scala.actor.Actor

/**
  * Created by shouf on 2016/5/11.
  */
object ActorTest extends App {
  First_Actor.start()
  Second_Actor.start()
}


object First_Actor extends Actor {
  override def act: Unit ={
    println(s"first:${Thread.currentThread().getName}")
    for(i <- 1 to 10){
      Thread.sleep(2000)
    }
  }
}

object Second_Actor extends Actor{
  override def act: Unit ={
    println(s"first:${Thread.currentThread().getName}")
    for (i <- 1 to 10){
      println(s"second:${i}")
      Thread.sleep(2000)
    }
  }
}